<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateCustomerAdminsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('customer_admins', function(Blueprint $table)
		{
			$table->integer('id', true);
			$table->integer('customer_id')->comment('关联customers表 的id ');
			$table->string('name', 60)->nullable()->comment('管理员的名称');
			$table->string('account', 176)->unique('ca_acnt')->comment('登录账号');
			$table->string('password')->comment('登录密码');
			$table->string('email')->nullable()->comment('邮箱地址');
			$table->string('phone', 80)->nullable()->comment('手机号');
			$table->boolean('sex')->default(0)->comment('性别 0 未知 1：男，2：女');
			$table->string('reset_token')->nullable()->comment('重置密码的Token');
			$table->text('remember_token', 65535)->nullable()->comment('jwt 的token字符串');
			$table->boolean('is_deleted')->default(0)->comment('管理员是否禁用 0：启用。1：禁用');
			$table->string('language', 50)->default('zh-CN')->comment('语言的设置');
			$table->timestamps();
			$table->dateTime('born_at')->nullable()->comment('生日');
		});
	}


	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('customer_admins');
	}

}
